package com.cx.atguigu.controller;

import com.cx.atguigu.service.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.method.ParameterErrors;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @Author atguigu
 * @Create 2025/8/25 23:22
 * @Version 1.0
 */
@RestController
public class DeclarativeAIServiceController {
    @Resource
    private ChatAssistant  chatAssistantQwen;

    // http://localhost:9003/lc4j/boot/declarative
    @GetMapping(value = "/lc4j/boot/declarative")
    public String declarative(@RequestParam(value = "prompt",defaultValue = "你好,你是谁") String prompt) {
        return chatAssistantQwen.chat(prompt);
    }
}
